﻿using System.Windows.Forms;
using pub.CmdUI.Cmd;
using pub.CmdUI.UI.Control;

namespace todo.Cmd.View
{
    public class ZoomInCmd : BaseZoomCmd
    {
        public ZoomInCmd()
        {
            this.Shortcut = new CmdShortcut(Keys.Control | Keys.Oemplus);
        }

        public override void Execute(IControlUI controlUi)
        {
            var zoom = GetZoom();
            if (zoom < 100)
            {
                zoom += 5;
            }
            else if (zoom < 200)
            {
                zoom += 10;
            }
            else if (zoom < 500)
            {
                zoom += 15;
            }
            else
            {
                zoom += 20;
            }
            if (zoom > 800)
            {
                zoom = 800;
            }
            SetZoom(zoom);
        }
    }
}